package viper.diversity;

public class Test364 {/**
/**
 * @author Joe Coyne
 * 
 * Revision number: 1
 * Author: Joe Coyne
 * Date created: 03/15/09
 * Date of Last Back-up on SVN: 03/15/2010
 * 
 * <p>Tests the 3,6,4 Scheme
 */
public static void main(String[] args) {
	//DD diverse = new DD();
	byte [] uno = {0,1,2,3,4};
	byte [] dos = {5,6,7,8,9};
	byte [] tres = {10,11,12,13,14};
	byte [][] first = Diversity.diversify(uno, dos, tres);
	for ( int i=0; i <first.length; i++){

			System.out.print("Packet "+ i+ " is:[");
			for(int j = 0; j<first[i].length; j++){
				System.out.print(first[i][j]+", ");
			}
			System.out.println("]");
		}



	System.out.print("Perfect transmission Packet 1,2,3,4,5,6 yields:\n"); 
	byte [] [] undddd = Dediversity.undiversify(first[0],first[1], first[2], first[3], first[4],first[5]);
	for ( int i=0; i <undddd.length; i++){
		if(undddd[i]==null){
			System.out.print("Packet "+ i + " is null\n");	
		}
		else{
			System.out.println("Packet "+ i+ " is:[");
			for(int j = 0; j<undddd[i].length; j++){
				System.out.print(undddd[i][j]+", ");
			}
			System.out.println("]");
		}
	}
	System.out.print("\n\n Transmission Packet 1,2,5 yields:\n"); 
	undddd = Dediversity.undiversify(first[0],first[1], null, null, first[4], null);
	for ( int i=0; i <undddd.length; i++){
		if(undddd[i]==null){
			System.out.print("Packet "+ i + " is null\n");	
		}
		else{
			System.out.println("Packet "+ i+ " is:[");
			for(int j = 0; j<undddd[i].length; j++){
				System.out.print(undddd[i][j]+", ");
			}
			System.out.println("]");
		}
	}
	System.out.print("\n\n Transmission Packet 2,4,5 yields:\n"); 
	undddd = Dediversity.undiversify(null,first[1], null, first[3], first [4], null);
	for ( int i=0; i <undddd.length; i++){
		if(undddd[i]==null){
			System.out.print("Packet "+ i + " is null\n");	
		}
		else{
			System.out.println("Packet "+ i+ " is:[");
			for(int j = 0; j<undddd[i].length; j++){
				System.out.print(undddd[i][j]+", ");
			}
			System.out.println("]");
		}
	}
	System.out.print("\n\n Transmission Packet 3,4,5 yields:\n"); 
	undddd = Dediversity.undiversify(null,null, first[2], first[3], first [4], null);
	for ( int i=0; i <undddd.length; i++){
		if(undddd[i]==null){
			System.out.print("Packet "+ i + " is null\n");	
		}
		else{
			System.out.println("Packet "+ i+ " is:[");
			for(int j = 0; j<undddd[i].length; j++){
				System.out.print(undddd[i][j]+", ");
			}
			System.out.println("]");
		}
	}
	System.out.print("\n\n Transmission Packet 4,5,6 yields:\n"); 
	undddd = Dediversity.undiversify(null,null, null, first[3], first [4], first[5]);
	for ( int i=0; i <undddd.length; i++){
		if(undddd[i]==null){
			System.out.print("Packet "+ i + " is null\n");	
		}
		else{
			System.out.println("Packet "+ i+ " is:[");
			for(int j = 0; j<undddd[i].length; j++){
				System.out.print(undddd[i][j]+", ");
			}
			System.out.println("]");
		}
	}
	System.out.print("\n\n Transmission Packet 1,2,4 yields:\n"); 
	undddd = Dediversity.undiversify(first[0],first[1], null, first[3], null, null);
	for ( int i=0; i <undddd.length; i++){
		if(undddd[i]==null){
			System.out.print("Packet "+ i + " is null\n");	
		}
		else{
			System.out.println("Packet "+ i+ " is:[");
			for(int j = 0; j<undddd[i].length; j++){
				System.out.print(undddd[i][j]+", ");
			}
			System.out.println("]");
		}
	}
	System.out.print("\n\n Transmission Packet 3,6 yields:\n"); 
	undddd = Dediversity.undiversify(null,null, first[2], null, null, first[5]);
	for ( int i=0; i <undddd.length; i++){
		if(undddd[i]==null){
			System.out.print("Packet "+ i + " is null\n");	
		}
		else{
			System.out.println("Packet "+ i+ " is:[");
			for(int j = 0; j<undddd[i].length; j++){
				System.out.print(undddd[i][j]+", ");
			}
			System.out.println("]");
		}
	}
	System.out.print("\n\n Transmission Packet 2,6 yields:\n"); 
	undddd = Dediversity.undiversify(null,first[1], null,null, null, first[5]);
	for ( int i=0; i <undddd.length; i++){
		if(undddd[i]==null){
			System.out.print("Packet "+ i + " is null\n");	
		}
		else{
			System.out.println("Packet "+ i+ " is:[");
			for(int j = 0; j<undddd[i].length; j++){
				System.out.print(undddd[i][j]+", ");
			}
			System.out.println("]");
		}
	}
	System.out.print("\n\n Transmission Packet 3,5 yields:\n"); 
	undddd = Dediversity.undiversify(null,null, first[2],null, first[4], null);
	for ( int i=0; i <undddd.length; i++){
		if(undddd[i]==null){
			System.out.print("Packet "+ i + " is null\n");	
		}
		else{
			System.out.print("Packet "+ i+ " is:[");
			for(int j = 0; j<undddd[i].length; j++){
				System.out.print(undddd[i][j]+", ");
			}
			System.out.println("]");
		}
	}
	
	
}
}
